require("../../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pagesA/pages/mallA/searchlist" ], {
    "26f9": function(t, a, i) {
        (function(c) {
            Object.defineProperty(a, "__esModule", {
                value: !0
            }), a.default = void 0;
            var t, u = (t = i("a34a")) && t.__esModule ? t : {
                default: t
            };
            function l(t, e, n, a, o, i, r) {
                try {
                    var s = t[i](r), c = s.value;
                } catch (t) {
                    return n(t), 0;
                }
                s.done ? e(c) : Promise.resolve(c).then(a, o);
            }
            function n(s) {
                return function() {
                    var t = this, r = arguments;
                    return new Promise(function(e, n) {
                        var a = s.apply(t, r);
                        function o(t) {
                            l(a, e, n, o, i, "next", t);
                        }
                        function i(t) {
                            l(a, e, n, o, i, "throw", t);
                        }
                        o(void 0);
                    });
                };
            }
            var o = getApp(), e = {
                data: function() {
                    return {
                        module_name: o.globalData.module_name,
                        userinfo: c.getStorageSync("userinfo"),
                        setting: c.getStorageSync("setting"),
                        sharetitle: "",
                        sharepic: "",
                        showAlert_login: !1,
                        wxCode: "",
                        scrollTimer: null,
                        top: 0,
                        footerCurrent: 0,
                        cityid: 40,
                        cityCode: 500100,
                        lat: 0,
                        lon: 0,
                        navItems: [ {
                            title: " "
                        } ],
                        navIndex: 0,
                        navType: "",
                        mallpagesize: 20,
                        mallgoodslist: [],
                        loadStatus: "loadmore",
                        loadText: {
                            loadmore: "上拉加载更多",
                            loading: "努力加载中",
                            nomore: "实在没有了"
                        },
                        scrollTop: 0,
                        windowHeight: c.getStorageSync("windowHeight"),
                        keyword: "",
                        copyTxt: "",
                        CustomBar: this.CustomBar,
                        type: "",
                        tabsHeight: 0,
                        termsHeight: 0,
                        activeIndex: 0,
                        sortType: 0,
                        suggestHeight: 0,
                        allTop: 0,
                        screenTop: 0,
                        terms_height: 0,
                        search_height: 0,
                        tabs_height: 0,
                        headerHeight: c.getStorageSync("headerHeight"),
                        page: 1,
                        appear: !1,
                        showSkeleton: !0,
                        showScreen: !1,
                        isBusy: !1,
                        nodata: !1,
                        nomore: !1,
                        checked: !1,
                        isfixed: !1,
                        toggleType: !1,
                        modeType: !0,
                        suggestShow: !1,
                        isShowClip: !1,
                        moreParam: {
                            priceStart: "",
                            priceEnd: "",
                            shopType: 1
                        },
                        suggestList: [],
                        searchTerms: [ {
                            type: "default",
                            name: "综合"
                        }, {
                            type: "sale",
                            name: "销量"
                        }, {
                            type: "price",
                            name: "价格"
                        } ],
                        listData: [],
                        margin_top_30: 0,
                        search_placeholder: ""
                    };
                },
                components: {},
                props: {},
                onReady: function() {
                    var e = this;
                    return n(u.default.mark(function t() {
                        return u.default.wrap(function(t) {
                            for (;;) switch (t.prev = t.next) {
                              case 0:
                                return t.next = 2, e.$onLaunched;

                              case 2:
                              case "end":
                                return t.stop();
                            }
                        }, t);
                    }))();
                },
                onShow: function() {
                    var e = this;
                    return n(u.default.mark(function t() {
                        return u.default.wrap(function(t) {
                            for (;;) switch (t.prev = t.next) {
                              case 0:
                                return t.next = 2, e.$onLaunched;

                              case 2:
                              case "end":
                                return t.stop();
                            }
                        }, t);
                    }))();
                },
                onLoad: function(r) {
                    var s = this;
                    return n(u.default.mark(function t() {
                        var e, n, a, o, i;
                        return u.default.wrap(function(t) {
                            for (;;) switch (t.prev = t.next) {
                              case 0:
                                return t.next = 2, s.$onLaunched;

                              case 2:
                                if (n = r, (e = s).setting = c.getStorageSync("setting"), e.userinfo = c.getStorageSync("userinfo"), 
                                e.headerHeight = c.getStorageSync("headerHeight"), a = c.getStorageSync("setting").index_malltype, 
                                (0 < c.getStorageSync("setting").youxuan_no || 0 == c.getStorageSync("setting").youxuan_no) && a.splice(+c.getStorageSync("setting").youxuan_no, 1), 
                                e.navItems = a, o = 0, n.mall_type) {
                                    for (i in a) -1 != a[i].type.indexOf(n.mall_type) && (e.navIndex = i, e.navType = a[i].type, 
                                    e.navQuery = a[i].query, e.searchTerms = a[i].searchTerms, o = 1);
                                    0 == o && (e.navType = a[0].type, e.navQuery = a[0].query, e.searchTerms = a[0].searchTerms);
                                } else e.navType = a[0].type, e.navQuery = a[0].query, e.searchTerms = a[0].searchTerms;
                                e.search_placeholder = e.setting.index_search_placeholder || "搜索商品标题，先领券再购买", s.keyword = r.keyword, 
                                s.margin_top_30 = c.upx2px(20), s.screenTop = s.allTop = 0, setTimeout(function() {
                                    c.createSelectorQuery().select(".search").boundingClientRect(function(t) {
                                        t && (e.screenTop += t.height, e.allTop += t.height, e.search_height = t.height);
                                    }).exec(), c.createSelectorQuery().select(".cont-tabs").boundingClientRect(function(t) {
                                        e.tabs_height = c.upx2px(80), t && (e.tabsHeight = e.tabs_height, e.screenTop += e.tabs_height, 
                                        e.allTop += e.tabs_height);
                                    }).exec(), c.createSelectorQuery().select(".cont-terms").boundingClientRect(function(t) {
                                        t && (e.termsHeight = t.height, e.screenTop += t.height, e.allTop += t.height, e.terms_height = t.height);
                                    }).exec();
                                }, 100), s.getList("refresh");

                              case 16:
                              case "end":
                                return t.stop();
                            }
                        }, t);
                    }))();
                },
                onReachBottom: function() {
                    "nomore" != this.loadStatus && this.getList();
                },
                onPageScroll: function(t) {
                    this.scrollTop = t.scrollTop, this.isfixed = t.scrollTop > this.tabsHeight, this.showScreen = !1, 
                    this.appear = t.scrollTop > this.scrollHeight;
                    var e = this.allTop - t.scrollTop, t = this.termsHeight;
                    this.screenTop = e < t ? t : e;
                },
                methods: {
                    openGoods: function(t) {
                        "youxuan" == t.currentTarget.dataset.pingtai ? c.navigateToMiniProgram({
                            appId: t.currentTarget.dataset.appid,
                            path: t.currentTarget.dataset.path
                        }) : "group" == t.currentTarget.dataset.pingtai ? c.navigateTo({
                            url: "../meituangroup/detail?id=".concat(t.currentTarget.dataset.shopid, "&cat0_id=").concat(t.currentTarget.dataset.cat0_id, "&lng=").concat(c.getStorageSync("lon"), "&lat=").concat(c.getStorageSync("lat"), "&cityid=").concat(t.currentTarget.dataset.city_id)
                        }) : c.navigateTo({
                            url: "detail?pt=" + t.currentTarget.dataset.pingtai + "&goodsid=" + t.currentTarget.dataset.goodsid + "&goodssign=" + t.currentTarget.dataset.goodssign + "&search_id=" + t.currentTarget.dataset.search_id
                        });
                    },
                    search_blur: function() {
                        this.search_placeholder = this.setting.index_search_placeholder || "搜索商品标题，先领券再购买";
                    },
                    search_focus: function() {
                        this.search_placeholder = "";
                    },
                    navChange: function(t) {
                        c.showLoading({
                            title: "加载中...",
                            mask: !1
                        }), c.pageScrollTo({
                            scrollTop: 0,
                            duration: 0
                        }), this.navIndex = t, this.navType = this.navItems[t].type, this.navQuery = this.navItems[t].query, 
                        this.searchTerms = this.navItems[t].searchTerms, this.page = 1, this.loadStatus = "loadmore", 
                        "youxuan" == this.navItems[t].type && c.getStorageSync("lon") && c.getStorageSync("lat") || "youxuan" != this.navItems[t].type ? this.getList() : this.getLocation();
                    },
                    transition: function(t) {
                        t = t.detail.dx;
                        this.$refs.uTabs.setDx(t);
                    },
                    animationfinish: function(t) {
                        t = t.detail.current;
                        this.$refs.uTabs.setFinishCurrent(t), this.swiperCurrent = t, this.current = t;
                    },
                    getList: function(n, t) {
                        var e, a = this;
                        if (-1 != this.setting.index_search_keywords.indexOf(this.keyword)) return this.loadStatus = "nomore", 
                        this.listData = [], void c.hideLoading();
                        "refresh" == n && (this.page = 1, this.backTop()), c.showLoading({
                            title: "加载中...",
                            mask: !1
                        }), n = this, "youxuan" != a.navType || 0 < c.getStorageSync("lat") && 0 < c.getStorageSync("lon") ? (a.loadStatus = "loading", 
                        e = o.globalData.util.url("entry/wxapp/mallgoodslist2", {
                            m: o.globalData.module_name
                        }), c.request({
                            url: e,
                            method: "POST",
                            header: {
                                "content-type": "application/x-www-form-urlencoded"
                            },
                            data: {
                                openid: c.getStorageSync("openid"),
                                type: a.navType,
                                query: a.navQuery,
                                pagesize: a.mallpagesize,
                                lon: c.getStorageSync("lon"),
                                lat: c.getStorageSync("lat"),
                                keyword: a.keyword,
                                page: a.page,
                                sort_type: a.sortType,
                                system_type: c.getStorageSync("systemtype")
                            },
                            success: function(t) {
                                var e;
                                200 == t.data.code && (e = t.data.mallgoodslist, 1 == t.data.has_more ? n.loadStatus = "loadmore" : n.loadStatus = "nomore", 
                                n.page = t.data.page, 1 == n.page ? (n.mallpagesize = t.data.pagesize, n.listData = [], 
                                n.listData = e) : e && (n.listData ? n.listData = n.listData.concat(e) : n.listData = e), 
                                n.page++, e || n.listData ? 1 == t.data.has_more && n.listData.length < 6 && (c.showLoading({
                                    title: "加载中...",
                                    mask: !1
                                }), n.getList()) : 1 == t.data.has_more && (c.showLoading({
                                    title: "加载中...",
                                    mask: !1
                                }), n.getList())), c.hideLoading();
                            }
                        })) : a.getLocation();
                    },
                    getLocation: function() {
                        var n = this;
                        c.getLocation({
                            type: "wgs84",
                            success: function(t) {
                                var e = o.globalData.util.url("entry/wxapp/address", {
                                    m: o.globalData.module_name
                                });
                                c.setStorageSync("lon", t.longitude), c.setStorageSync("lat", t.latitude), c.request({
                                    url: e,
                                    method: "POST",
                                    header: {
                                        "content-type": "application/x-www-form-urlencoded"
                                    },
                                    data: {
                                        lon: t.longitude,
                                        lat: t.latitude
                                    },
                                    success: function(t) {
                                        c.setStorageSync("cityCode", t.data.data.cityCode), c.setStorageSync("city", t.data.data.city), 
                                        c.setStorageSync("cityid", t.data.data.ci), 0 < t.data.data.ci && 0 < c.getStorageSync("lat") ? n.getList("refresh") : c.showModal({
                                            title: "系统提示",
                                            content: "请授权获取您的位置信息",
                                            showCancel: !0,
                                            success: function(t) {
                                                t.confirm && n.getList("refresh"), n.listData = [], n.loadStatus = "nomore", c.setStorageSync("lon", ""), 
                                                c.setStorageSync("lat", ""), c.setStorageSync("cityCode", ""), c.setStorageSync("city", ""), 
                                                c.setStorageSync("cityid", ""), c.hideLoading();
                                            }
                                        });
                                    }
                                });
                            },
                            fail: function(t) {
                                n.listData = [], n.loadStatus = "nomore", c.setStorageSync("lon", ""), c.setStorageSync("lat", ""), 
                                c.setStorageSync("cityCode", ""), c.setStorageSync("city", ""), c.setStorageSync("cityid", ""), 
                                c.hideLoading();
                            }
                        });
                    },
                    again_getLocation: function() {
                        var e = this;
                        c.getSetting({
                            success: function(t) {
                                null != t.authSetting["scope.userLocation"] && 1 != t.authSetting["scope.userLocation"] ? c.showModal({
                                    title: "是否授权当前位置",
                                    content: "需要获取您的地理位置，请确认授权，否则无法获取您所需数据",
                                    success: function(t) {
                                        t.cancel ? c.showToast({
                                            title: "授权失败",
                                            icon: "success",
                                            duration: 1e3
                                        }) : t.confirm && c.openSetting({
                                            success: function(t) {
                                                1 == t.authSetting["scope.userLocation"] ? (c.showToast({
                                                    title: "授权成功",
                                                    icon: "success",
                                                    duration: 1e3
                                                }), e.getLocation(e)) : c.showToast({
                                                    title: "授权失败",
                                                    icon: "success",
                                                    duration: 1e3
                                                });
                                            }
                                        });
                                    }
                                }) : (t.authSetting["scope.userLocation"], e.getLocation(e));
                            }
                        });
                    },
                    onChange: function(t) {
                        this.keyword = t.detail.value;
                    },
                    toSearch: function(t) {
                        this.keyword = t, this.onSearch();
                    },
                    onSearch: function() {
                        "" != this.keyword.trim() ? this.getList("refresh", !0) : c.showToast({
                            title: "搜索内容不能为空",
                            duration: 2e3,
                            icon: "none"
                        });
                    },
                    clear: function() {
                        this.keyword = "";
                    },
                    changeType: function(t) {
                        this.type = t.type, this.getList("refresh", !0);
                    },
                    onTermClick: function(t, e) {
                        this.activeIndex == e ? this.toggleType = !this.toggleType : this.toggleType = "sale" !== t.type, 
                        "default" === t.type ? this.sortType = 0 : "price" === t.type ? this.sortType = this.toggleType ? 5 : 4 : "sale" === t.type && (this.sortType = this.toggleType ? 3 : 2), 
                        this.activeIndex = e, this.showScreen = !1, this.getList("refresh", !0);
                    },
                    hideScreen: function() {
                        this.showScreen = !1;
                    },
                    onReset: function() {
                        this.moreParam.priceStart = "", this.moreParam.priceEnd = "", this.moreParam.shopType = 1, 
                        this.onScreen();
                    },
                    onScreen: function() {
                        this.showScreen = !1, this.getList("refresh", !0);
                    },
                    changeSwitch: function(t) {
                        this.checked = t.detail.value, this.getList("refresh", !0);
                    },
                    toDetail: function(t) {
                        this.$common.openDetailPage(t);
                    },
                    backTop: function() {
                        c.pageScrollTo({
                            scrollTop: 0,
                            duration: 0
                        });
                    }
                }
            };
            a.default = e;
        }).call(this, i("543d").default);
    },
    3472: function(t, e, n) {
        n.r(e);
        var a, o = n("26f9"), i = n.n(o);
        for (a in o) "default" !== a && function(t) {
            n.d(e, t, function() {
                return o[t];
            });
        }(a);
        e.default = i.a;
    },
    "9e74": function(t, e, n) {
        n.d(e, "b", function() {
            return o;
        }), n.d(e, "c", function() {
            return i;
        }), n.d(e, "a", function() {
            return a;
        });
        var a = {
            uSearch: function() {
                return n.e("uview-ui/components/u-search/u-search").then(n.bind(null, "6bb4"));
            },
            uTabsSwiper: function() {
                return Promise.all([ n.e("common/vendor"), n.e("uview-ui/components/u-tabs-swiper/u-tabs-swiper") ]).then(n.bind(null, "d492"));
            },
            uImage: function() {
                return n.e("uview-ui/components/u-image/u-image").then(n.bind(null, "871d"));
            },
            uLoading: function() {
                return n.e("uview-ui/components/u-loading/u-loading").then(n.bind(null, "54b5"));
            },
            uIcon: function() {
                return n.e("uview-ui/components/u-icon/u-icon").then(n.bind(null, "bee6"));
            },
            uGap: function() {
                return n.e("uview-ui/components/u-gap/u-gap").then(n.bind(null, "130d"));
            },
            uEmpty: function() {
                return n.e("uview-ui/components/u-empty/u-empty").then(n.bind(null, "b399"));
            },
            uButton: function() {
                return n.e("uview-ui/components/u-button/u-button").then(n.bind(null, "cad8"));
            },
            uLoadmore: function() {
                return n.e("uview-ui/components/u-loadmore/u-loadmore").then(n.bind(null, "2220"));
            },
            uBackTop: function() {
                return n.e("uview-ui/components/u-back-top/u-back-top").then(n.bind(null, "feb3"));
            }
        }, o = function() {
            this.$createElement;
            this._self._c;
        }, i = [];
    },
    a746: function(t, e, n) {
        n.r(e);
        var a, o = n("9e74"), i = n("3472");
        for (a in i) "default" !== a && function(t) {
            n.d(e, t, function() {
                return i[t];
            });
        }(a);
        n("d6d1");
        var r = n("f0c5"), o = Object(r.a)(i.default, o.b, o.c, !1, null, null, null, !1, o.a, void 0);
        e.default = o.exports;
    },
    d6d1: function(t, e, n) {
        var a = n("f9a6");
        n.n(a).a;
    },
    ddba: function(t, e, n) {
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            n("0cda"), e(n("66fd")), t(e(n("a746")).default);
        }).call(this, n("543d").createPage);
    },
    f9a6: function(t, e, n) {}
}, [ [ "ddba", "common/runtime", "common/vendor" ] ] ]);